UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zxGOfMyxXhcpth9aEeeEMYd3/apdYHGVTGKRtlLv6UE='
WHERE
key_id = '1ae721da06e2c9e266c97abb818d919c32c3067ac36ff4ee59e90338d3a0b896'
AND (
token = 'zxGOfMyxXhcpth9aEeeEMYd3/apdYHGVTGKRtlLv6UE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)