UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KaDwDNynK432HmEx9CkMkEb7cWKXiU6lvdvev3dEUBU='
WHERE
key_id = '73ee3cbbcf44aa18af6a8e93a959110ce0dc24ab1bebf6e36d45cbbfc385091d'
AND (
token = 'KaDwDNynK432HmEx9CkMkEb7cWKXiU6lvdvev3dEUBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)