UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sVQtiue2SCtiCGQ5b3DabqUgROk/IkBBQsRIfGJ4xh8='
WHERE
key_id = 'fac964c27454050ea350781a4109a076d10b45e1ddb64fa2df0026a462682875'
AND (
token = 'sVQtiue2SCtiCGQ5b3DabqUgROk/IkBBQsRIfGJ4xh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)