UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mackhPyQU2n27oDNzIlNW7v6ftb/2Nfr6t2hx6EI77E=' 
WHERE 
  key_id = 'bc8d3eab48b2d99d7684c5345f0a0335c9506669235e5b102d206cd237aac6ea' 
  AND (
    token = 'mackhPyQU2n27oDNzIlNW7v6ftb/2Nfr6t2hx6EI77E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034