UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gKQBsF17qiQHLK36bZie2bBT+VQGo1860nJryB96zvM=' 
WHERE 
  key_id = '3b2695fcc2b96d463f475e0dba558065956007c3eb91926a9839ed3ed6729f0a' 
  AND (
    token = 'gKQBsF17qiQHLK36bZie2bBT+VQGo1860nJryB96zvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017