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