UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11X0osrh27GU6rbYRdotCv+Lo9hCXqVQziBpe+bCP/Q='
WHERE
key_id = '5b94d42ab29dd85f854753a30ee0a2171d589c31baa90dddb15fa840ae0210ec'
AND (
token = '11X0osrh27GU6rbYRdotCv+Lo9hCXqVQziBpe+bCP/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)