UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5qgRQUMyQI0/SVPRiFTreJeoCmbLw+LvZdY+1/Lmh/Y='
WHERE
key_id = '6472610f311986039fbde01f28973fbcc51052a7e35afe38ecf4fe6e0160d029'
AND (
token = '5qgRQUMyQI0/SVPRiFTreJeoCmbLw+LvZdY+1/Lmh/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)