UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vPb2i/CZssCnVf2sRkehaS9saAnAyXMHj3NPFT94fwM='
WHERE
key_id = '71a15bdb36fd739673fbc043b8fbb316f11e782e49a81fed9b91e36923fbeaf0'
AND (
token = 'vPb2i/CZssCnVf2sRkehaS9saAnAyXMHj3NPFT94fwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)