UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZeXMUyuBCoONSEeFjMNGlBJ2cM9U5MhqJzzkF9KRiPE='
WHERE
key_id = 'bd9d0eeed6df5068b374131f2fc6a17bc336422c0150fdfa03bde6dca3911385'
AND (
token = 'ZeXMUyuBCoONSEeFjMNGlBJ2cM9U5MhqJzzkF9KRiPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)