UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M8iMgKb9NCuquuxuO4L38aSpLT5M35uejLgR3ubvSvQ='
WHERE
key_id = '7effecd7943bed8be131360bbd2ad6415f20fe1dd975017e3b9926834a3e8f43'
AND (
token = 'M8iMgKb9NCuquuxuO4L38aSpLT5M35uejLgR3ubvSvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)