UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7m9nOa/Le2CH6IUHy5lKQj2/kjY/Svn8v6kdBhB2IAo=' 
WHERE 
  key_id = '9238bbd5b88ab3a6cd47ea91c06babb680ea5c1e0c341596b9205e7960fa404c' 
  AND (
    token = '7m9nOa/Le2CH6IUHy5lKQj2/kjY/Svn8v6kdBhB2IAo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030