UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Th3mgxswUO0YJFoTr7ZvBfrNVzkD/nYevOqbPCbNuZI='
WHERE
key_id = '51f33203e6d2b45d126e204cb49871daaff57cb06bd38ca04429c547c7e4fb3e'
AND (
token = 'Th3mgxswUO0YJFoTr7ZvBfrNVzkD/nYevOqbPCbNuZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)