UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NgFySpz5ndURBAk5A2b+JhcCwWbg3hbv6eoZbhpkgO8=' 
WHERE 
  key_id = '6094542b0a3ef27e4b17fe15c8629d7ca8ffc74583616ad3ede8f6f5afc438a6' 
  AND (
    token = 'NgFySpz5ndURBAk5A2b+JhcCwWbg3hbv6eoZbhpkgO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034