UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '93/LsLC30JXa8jyZo2ycOjlkTtmramdjcC4HpCUEfCw=' 
WHERE 
  key_id = '74c0dc1892f44b2720815ca2992d774389d88adfb85cc40ab8f2db96fbcce561' 
  AND (
    token = '93/LsLC30JXa8jyZo2ycOjlkTtmramdjcC4HpCUEfCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025