UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QG2dRkPHmqVmwe9cznNocN/vnht75oiYPNAgEHJSXjY=' 
WHERE 
  key_id = '886f420a0dbdca690add7c0b18ec372b33a1d7430dfbe937b74f8fcd54b87f54' 
  AND (
    token = 'QG2dRkPHmqVmwe9cznNocN/vnht75oiYPNAgEHJSXjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045