UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tCG/wwZ8RxbY7gzoBYS0tvpSmypuWZiOpyJo3Torwrs=' 
WHERE 
  key_id = '68cc41a342530c5c5e5ab69f851bb480aeda7f4f486bd7f520badef591fcbca0' 
  AND (
    token = 'tCG/wwZ8RxbY7gzoBYS0tvpSmypuWZiOpyJo3Torwrs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046