UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zUb5DthJfgWsR1Ae8wRkLz+VBi197Cc47JGrPOwgzuo='
WHERE
key_id = 'f7f3d3c830493813dd86732c8ef5fe67bf268c00b0ad9394a209c8b9768b6d1c'
AND (
token = 'zUb5DthJfgWsR1Ae8wRkLz+VBi197Cc47JGrPOwgzuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)