UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ajk4Jwv/B6NMHWE2Hg1kWA+CF3rkgZ2OTNH00mO9D5I=' 
WHERE 
  key_id = '516fcb41f67036cf04f37c5cfe7824044d0dd277633ae1b29f0b814a8bf1d6e8' 
  AND (
    token = 'Ajk4Jwv/B6NMHWE2Hg1kWA+CF3rkgZ2OTNH00mO9D5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031