UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WWW9kC4E3Sbcu+Pr2JsdUTVs4+mwzK2kuxQvL4e8aYQ='
WHERE
key_id = 'f742788980e2734a71937eebbdb6fa0fbf405f67f15c4380944e208c39e57c27'
AND (
token = 'WWW9kC4E3Sbcu+Pr2JsdUTVs4+mwzK2kuxQvL4e8aYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)