UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZG73szkpSRmpY2J6+SGSU6z3Pdlmu34HqjhJhy1H/1o='
WHERE
key_id = '9b6175fdd3f26e52598ccd33e1bc61b83e3080e77ca9c7e91fcde98651936795'
AND (
token = 'ZG73szkpSRmpY2J6+SGSU6z3Pdlmu34HqjhJhy1H/1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)