UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ey9gblb6Oauwp+RJ5t1i5OvHXKJuuXvijB5h0oEqeD8='
WHERE
key_id = '88d1cbc1712799e7be45d6571aae6ac899328b5f5250e2856a44dca65124fe5b'
AND (
token = 'ey9gblb6Oauwp+RJ5t1i5OvHXKJuuXvijB5h0oEqeD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)