UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MfMGF6V/RyvcR4L94fKYjClijQNHmsS7A/3dmDunlLk=' 
WHERE 
  key_id = '1fa6f7118b6a57ecfc424988416d1ab0bd0d3412e3675de085723af6606345ee' 
  AND (
    token = 'MfMGF6V/RyvcR4L94fKYjClijQNHmsS7A/3dmDunlLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050