UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AnOhLyWOeUQx14cTxc1AyixdCPuYjzaw9TLxq6Z7u88='
WHERE
key_id = '33741d3726ec7db352d296c206e6f47006283535cc6e9f35abb22e645403ab97'
AND (
token = 'AnOhLyWOeUQx14cTxc1AyixdCPuYjzaw9TLxq6Z7u88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)