UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oe2rn/YudHgIvPGvnNpil/wQ5OQIg9mQ5mY1/z/ec3U='
WHERE
key_id = 'aae60c912c6f4856e3f35d8794fc3242eaf77fa2a1654184d968a31324df76ab'
AND (
token = 'Oe2rn/YudHgIvPGvnNpil/wQ5OQIg9mQ5mY1/z/ec3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)