UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'axBhJc4cuFGejK5oLn3SmAd12v8RjwrifGxMZXYcFjY=' 
WHERE 
  key_id = '909e3dde73aef54936e8fedcb477425141be5ac51c32d3e037fb0880e7832608' 
  AND (
    token = 'axBhJc4cuFGejK5oLn3SmAd12v8RjwrifGxMZXYcFjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027