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