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