UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ct3lbkWm5OTJopBh5ZIv+dOQPJbrgezT8O6VbfkxmNg=' 
WHERE 
  key_id = 'ecfad93f8afc404dd8bf2580b2e13b98699dff91141f0677df23c6314d2d7b21' 
  AND (
    token = 'Ct3lbkWm5OTJopBh5ZIv+dOQPJbrgezT8O6VbfkxmNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038