UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IznJbMLZaDFNAmsf/ZhoFR2Av8BPsObSY5De5VDXhLo=' 
WHERE 
  key_id = '7c3a296c5148defeebb7f594f78ca628b07f794ef3bd8ff3023d756e6fe6fd1d' 
  AND (
    token = 'IznJbMLZaDFNAmsf/ZhoFR2Av8BPsObSY5De5VDXhLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017