UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BuRLAAHJri5uT5JXY1+pcmKuEHKrRGX/VuKErtV3Faw=' 
WHERE 
  key_id = '34e61fc8e4c424fc0a2550d29a53bbec068281d6c941876155c9ed2f2d584ee9' 
  AND (
    token = 'BuRLAAHJri5uT5JXY1+pcmKuEHKrRGX/VuKErtV3Faw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038