UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hpR5T/vDubPznhXBA08qwNq6eSZNrmLWEl5wSY+Xa88='
WHERE
key_id = '0ec7ac8a05a6bfc0a15908792cbbca6a81b64400734288ccbcc75dcc873baf29'
AND (
token = 'hpR5T/vDubPznhXBA08qwNq6eSZNrmLWEl5wSY+Xa88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)