UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1MS/Hu0q7RwhvKZ5oOomZC0rvll4ZrarPhf2FCEXX+g='
WHERE
key_id = '264961290b357bf20be891a3a0295c65a2dce3ee397e0b2a4567df21501b3cb8'
AND (
token = '1MS/Hu0q7RwhvKZ5oOomZC0rvll4ZrarPhf2FCEXX+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)