UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6//M0XLLGDfIjcJIsTRYDZ7afXJ4F/gLyDwj7CqWaRs='
WHERE
key_id = '0fc854adba2ae5019ba95e7e95f1dccc1c15622c06d8f5c02d321da2b88dc8fd'
AND (
token = '6//M0XLLGDfIjcJIsTRYDZ7afXJ4F/gLyDwj7CqWaRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)