UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bOmtR/Q1AY0jjHunXSqHzdaT1LvTKG8Vy0Qon1kPU4s='
WHERE
key_id = '8bed435290d2fe67355318aea4e6cff39ba7bc7dfa595423b6abbcfd64d2e571'
AND (
token = 'bOmtR/Q1AY0jjHunXSqHzdaT1LvTKG8Vy0Qon1kPU4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)