UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KXkUKWrK+Lvqu1/Cqrz8l8C1tpxFMs0g3tMVaI/T2nY='
WHERE
key_id = '9c8e94b3124a3f05efc9620295c54859c514996e8f894d70a4790d9ed269b0db'
AND (
token = 'KXkUKWrK+Lvqu1/Cqrz8l8C1tpxFMs0g3tMVaI/T2nY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)