UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+k7SrMd2/5R7c9MSV7DVOtTBmO9NPwYwQFauh5FTAbw=' 
WHERE 
  key_id = '67f812f82ceb3df7521cfd26cd35c0e014cf912cfbd915eed992188203d27de2' 
  AND (
    token = '+k7SrMd2/5R7c9MSV7DVOtTBmO9NPwYwQFauh5FTAbw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036