UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H1GkB3PMqNtEmwWeUC2DiTUnUVDwdu0GC5xpoGIOuJ0=' 
WHERE 
  key_id = 'ac3981b85bb40a71a9bfd81c978b17207feedf435bc85f759eaca760acc00ff5' 
  AND (
    token = 'H1GkB3PMqNtEmwWeUC2DiTUnUVDwdu0GC5xpoGIOuJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032