UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zQEaKc4u/rlHUDjaHAWmWpiZckbzZ4hkG2ZiDl13PhE='
WHERE
key_id = 'ca9fac90af6fcfc6580a92a1b1e2f8b4a7b29895f88c4233aca4ad8deb0070bc'
AND (
token = 'zQEaKc4u/rlHUDjaHAWmWpiZckbzZ4hkG2ZiDl13PhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)