UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fhBD0PgSVr2zPHtB2cfa54m/j9tCtRWrkyBGvWin2tc='
WHERE
key_id = 'aa748a3a1e6659eb93622e6bf46d18f57be03fc880145d8fe3516b79c83c5c8d'
AND (
token = 'fhBD0PgSVr2zPHtB2cfa54m/j9tCtRWrkyBGvWin2tc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)