UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'obN4u0bQdUkj4mdgAQu2/Yyiu9OLhwh4wkPM4zABDXk=' 
WHERE 
  key_id = '5390cc8ca0d3f24df96403c725bbb976b2a68dbd81ed5386294c60eb4c3586e5' 
  AND (
    token = 'obN4u0bQdUkj4mdgAQu2/Yyiu9OLhwh4wkPM4zABDXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026