UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BDFEfLJkQedZRhhTKldap2AI51ESXYP1qbSxcKUjSto='
WHERE
key_id = 'f7f66581c60194c3283710ca7b68b62ec51502b3e874861372b1e8647d2270a2'
AND (
token = 'BDFEfLJkQedZRhhTKldap2AI51ESXYP1qbSxcKUjSto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)