UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5bIpwxvf+pFPbgxy+apQYgaV4K7N5BoCHtiJWEeoJzA='
WHERE
key_id = '19708725b1fa23d899bb7cc6274f0e608acfbae165aecdf13382dc5c522154ac'
AND (
token = '5bIpwxvf+pFPbgxy+apQYgaV4K7N5BoCHtiJWEeoJzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)