UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sXgGNWe5X8DjiWfbqsAnzKnw5PC4e+Wo8mM7yLHsy/U='
WHERE
key_id = 'e8cf81bac7af82caf42755b389dbe55fd85ea0456cfdc3e2fe423af56d1891da'
AND (
token = 'sXgGNWe5X8DjiWfbqsAnzKnw5PC4e+Wo8mM7yLHsy/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)