UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '01tdBATZAifOl8e2mKvRthh1+HFzHFJthfDVqF05plI='
WHERE
key_id = 'eb3e20bb2353fa7f7cb043358d41fa6fb0e336fb18718098c6f62b2abc66744b'
AND (
token = '01tdBATZAifOl8e2mKvRthh1+HFzHFJthfDVqF05plI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)