UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Lw7yD5cSj5Y/2h9omntwEBy2utN6+PGH1lPNjhtgOA='
WHERE
key_id = 'd88d7748a48d0bcbc84e36e0fe812337cc7dd8d8be2f6bc37fe365dab2c2279f'
AND (
token = '5Lw7yD5cSj5Y/2h9omntwEBy2utN6+PGH1lPNjhtgOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)