UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YBvx3cwd510PJgWYo9lp0evSv+xDqHbFqn4oi5jtwLQ=' 
WHERE 
  key_id = '0bf7c26731fd523dabef9be022a7ab67f303e75d919adb611bbbd28e21dcfb18' 
  AND (
    token = 'YBvx3cwd510PJgWYo9lp0evSv+xDqHbFqn4oi5jtwLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018