UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2y5Y8sVOAj//AOtimGP/Oy/0/kYURZafEdROwzjc5rg=' 
WHERE 
  key_id = 'abc65175b3d6108120e33579b4f5d94229c4fd7b37d093482cb23cc3370a2518' 
  AND (
    token = '2y5Y8sVOAj//AOtimGP/Oy/0/kYURZafEdROwzjc5rg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044