UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U8bkXvG4FynjVEHZduKhoZ+PqUH4GQyj37pQy9CpcIA='
WHERE
key_id = '75b14d985fad9a94f5e4c7b26839017f58727a3a435599f638cff0c479a475b3'
AND (
token = 'U8bkXvG4FynjVEHZduKhoZ+PqUH4GQyj37pQy9CpcIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)