UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7AP1FZ1MUSeQojX/hPBfo/QwpRmrBk6SvEYXFbg1V1g='
WHERE
key_id = '4e288e99af55ad79aca405f3e28d6130d434f58097380e250b60c90ea65897cd'
AND (
token = '7AP1FZ1MUSeQojX/hPBfo/QwpRmrBk6SvEYXFbg1V1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)