UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9zNM22Rq7OOJkQkVLeOYzQhN+oWlEei5eMEa+iFKMEw='
WHERE
key_id = 'e14eade8b7705aa4bd51dc3655248215c12ccd62b207976ed2b0be133c000e51'
AND (
token = '9zNM22Rq7OOJkQkVLeOYzQhN+oWlEei5eMEa+iFKMEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)