UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mHH4rCdCMoorpx6qIe3zy1Yda15b1NFTzlIc9byZKso=' 
WHERE 
  key_id = '7937010899eccda336370cb84623f68c983233b3619aca0a68c036209c58a824' 
  AND (
    token = 'mHH4rCdCMoorpx6qIe3zy1Yda15b1NFTzlIc9byZKso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065