UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BFZha7hh5O/BqIr9262/eJi4LvaL5tOgesf1AA3DeWs='
WHERE
key_id = '690a3b3137f86269630a1d8abd39c0f5fbac266d453dcad44835232dca712180'
AND (
token = 'BFZha7hh5O/BqIr9262/eJi4LvaL5tOgesf1AA3DeWs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)