UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9x6/CGRT3klPK9e31kPqs4AVBhPJwjaqPg7rpEUlso4='
WHERE
key_id = 'eeb490b6704de8a87c6af51cd7b7c6d7b6ab582163e5f0da1cb501e905a1fc56'
AND (
token = '9x6/CGRT3klPK9e31kPqs4AVBhPJwjaqPg7rpEUlso4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)