UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TnuN8YXFnwU4E5d+f3yMYLD/gydveM7gZDXAePnAf1Q='
WHERE
key_id = '6320d69f240cf5c1316746cae7b83c3c53b3f8a8c3ddb0a8a683ee3da25adc3a'
AND (
token = 'TnuN8YXFnwU4E5d+f3yMYLD/gydveM7gZDXAePnAf1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)