UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cvi3IIMFOhg/65MJmXRP1ip5/CqHKF1gWyh2V6X3p38='
WHERE
key_id = '33d0cd9cbaf5f24ad2ac2f58d13924c4db66d6f668dd0ebc16d53c07968a4c45'
AND (
token = 'cvi3IIMFOhg/65MJmXRP1ip5/CqHKF1gWyh2V6X3p38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)