UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lg2GTSZqYWiBSbN3VLZZ2vTGOyy8kOmNjMRhGlSeDLY='
WHERE
key_id = '8f97d73393c9210f05d47ca0971df88f09f3a31de0f3341891ebd32a78fba70c'
AND (
token = 'lg2GTSZqYWiBSbN3VLZZ2vTGOyy8kOmNjMRhGlSeDLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)