UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mWCKr9kJ+CPEJ+vin5MsGqzgnpMDshxSHNd1zfE0NLo=' 
WHERE 
  key_id = 'ac11988cff6d77302ea3b0d00ad4eb3e0a6c896cfe8194727f4b78493f5c5b01' 
  AND (
    token = 'mWCKr9kJ+CPEJ+vin5MsGqzgnpMDshxSHNd1zfE0NLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020